package com.managerplat.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.managerplat.dao.OrdersDAO;
import com.managerplat.dao.SellerDAO;
import com.managerplat.dao.UserDAO;
import com.managerplat.dao.impl.SellerDAOImpl;
import com.managerplat.model.DishInfo;
import com.managerplat.model.OrderInfo;
import com.managerplat.model.SellerInfo;
import com.managerplat.model.Sellers;
import com.managerplat.service.SellersManager;

@Service("sm")
public class SellersManagerImpl implements SellersManager{
	@Autowired(required=true)
	private  SellerDAO dao;
	private UserDAO userDao;
	@Override
	public int sellerRegister(Sellers seller) {
		// TODO Auto-generated method stub
		return dao.saveSellersRegistInfo(seller);
	}

	public List<DishInfo> sellerLogin(String sellerName,String sellerPwd) {
		// TODO Auto-generated method stub
		return dao.findSellerMenu(dao.checkSeller(sellerName, sellerPwd));
	}

	@Override
	public List<SellerInfo> sendSellerInfoToUser() {
		// TODO Auto-generated method stub
		return dao.findSellerList();
	}

	@Override
	public List<DishInfo> sendDishInfoToUser(int sellerId) {
		// TODO Auto-generated method stub
	
		return dao.findSellerMenu(sellerId);
	}

	@Override
	public List<Sellers> showSellers(int isRegist) {
		// TODO Auto-generated method stub
		return dao.findUnRegistSellers(isRegist);
	}
	
	

	@Override
	public int getMenuOfSellerUpload(List<DishInfo> listDishInfo) {
		// TODO Auto-generated method stub
		
		return 0;
	}

	@Override
	public void confirmRegist(int sellerId) {
		// TODO Auto-generated method stub
		dao.updateIsRegist(sellerId);
	}

}
